package com.compomics.rover.gui.multiwizard;

import org.apache.log4j.Logger;

import com.compomics.rover.general.interfaces.WizardPanel;

import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: Niklaas
 * Date: 10-Dec-2009
 * Time: 16:33:27
 * To change this template use File | Settings | File Templates.
 */
public class OverviewPanel implements WizardPanel {
	// Class specific log4j logger for OverviewPanel instances.
	 private static Logger logger = Logger.getLogger(OverviewPanel.class);
    private JButton addAnOtherSourceButton;
    private JPanel jpanContent;
    private WizardFrameHolder iParent;

    public OverviewPanel(WizardFrameHolder lParent) {
        this.iParent = lParent;
        addAnOtherSourceButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                iParent.goToPanel(0);
            }
        });
    }

    public JPanel getContentPane() {
        return jpanContent;
    }

    public void backClicked() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void nextClicked() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public boolean feasableToProceed() {
        return true;
    }

    public String getNotFeasableReason() {
        return "";
    }

    public void construct() {
        if (iParent.getRoverSources().size() == 1) {
            iParent.setNextButtonEnabled(false);
        }
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        jpanContent = new JPanel();
        jpanContent.setLayout(new GridBagLayout());
        addAnOtherSourceButton = new JButton();
        addAnOtherSourceButton.setText("Add an other source");
        GridBagConstraints gbc;
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        jpanContent.add(addAnOtherSourceButton, gbc);
        final JPanel spacer1 = new JPanel();
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        jpanContent.add(spacer1, gbc);
        final JPanel spacer2 = new JPanel();
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.fill = GridBagConstraints.VERTICAL;
        jpanContent.add(spacer2, gbc);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return jpanContent;
    }
}
